
package me.zhengjie.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author IQW
* @date 2022-07-18
**/
@Entity
@Data
@Table(name="app_holiday")
public class AppHoliday implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "hol_id")
    @ApiModelProperty(value = "ID")
    private Integer holId;

    @Column(name = "area_id")
    @ApiModelProperty(value = "责任区ID")
    private Integer areaId;

    @Column(name = "user_id")
    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    @Column(name = "nick_name")
    @ApiModelProperty(value = "申请人")
    private String nickName;

    @Column(name = "avatar_path")
    @ApiModelProperty(value = "头像")
    private String avatarPath;

    @Column(name = "user_id1")
    @ApiModelProperty(value = "审批人ID")
    private Integer userId1;

    @Column(name = "nick_name1")
    @ApiModelProperty(value = "审批人")
    private String nickName1;

    @Column(name = "avatar_path1")
    @ApiModelProperty(value = "审批人头像")
    private String avatarPath1;

    @Column(name = "user_id2")
    @ApiModelProperty(value = "抄送人ID")
    private Integer userId2;

    @Column(name = "nick_name2")
    @ApiModelProperty(value = "抄送人")
    private String nickName2;

    @Column(name = "avatar_path2")
    @ApiModelProperty(value = "抄送人头像")
    private String avatarPath2;


    @Column(name = "work_no")
    @ApiModelProperty(value = "申请人工号")
    private String workNo;

    @Column(name = "phone")
    @ApiModelProperty(value = "申请人手机")
    private String phone;

    @Column(name = "cate")
    @ApiModelProperty(value = "类别ID")
    private String cate;

    @Column(name = "title")
    @ApiModelProperty(value = "类别名称")
    private String title;

    @Column(name = "content")
    @ApiModelProperty(value = "请假理由")
    private String content;

    @Column(name = "imgs")
    @ApiModelProperty(value = "附件")
    private String imgs;

    @Column(name = "start_time")
    @ApiModelProperty(value = "开始时间")
    private Timestamp startTime;

    @Column(name = "end_time")
    @ApiModelProperty(value = "结束时间")
    private Timestamp endTime;

    @Column(name = "days")
    @ApiModelProperty(value = "天数")
    private Float days;

    @Column(name = "reply")
    @ApiModelProperty(value = "审批内容")
    private String reply;

    @Column(name = "reply_time")
    @ApiModelProperty(value = "审批时间")
    private Timestamp replyTime;

    @Column(name = "status")
    @ApiModelProperty(value = "状态 0待审批、1通过、2不通过、3撤销")
    private Integer status;

    @Column(name = "create_time")
    @ApiModelProperty(value = "createTime")
    private Timestamp createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "updateTime")
    private Timestamp updateTime;

    public void copy(AppHoliday source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}